@extends('layouts.app')

@section('content')
<div class="content-header">
    <h1>配置列表</h1>
    <ol class="breadcrumb">
      <li><a href="{{ url('/') }}"><i class="fa fa-dashboard"></i> 首页</a></li>
      <li class="active">配置列表</li>
    </ol>
  </div>
<div class="content">
    @if (count($errors) > 0)
        <div class="alert alert-danger" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <ul>
            @foreach ($errors->all() as $error)
              <li>{{ $error }}</li>
            @endforeach
            </ul>
        </div>
    @endif
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    配置列表
                    <a href="{{url('project/create/'.$project['id'])}}" class="pull-right label label-primary">添加配置</a>
                </div>
                <div class="panel-body">
                    @foreach ($setting_list as $list)
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                           {{ $list->id }} - {{ $project['path_with_namespace'] }} - {{ $list->name }}
                            <a href="{{url('permission/set/'.$project['id'].'-'.$list->id)}}" class="pull-right  label label-primary">人员配置</a>
                        </div>
                        <div class="panel-body">
                            <dl class="dl-horizontal">
                                <dt>Repo ID</dt> <dd>{{ $list->repo_id }}</dd>
                                <dt>配置名称 </dt> <dd>{{ $list->name }}</dd>
                                <dt>ssh host </dt> <dd>{{ $list->ssh_host }}</dd>
                                <dt>Repo Url </dt> <dd>{{ $list->repo_url }}</dd>
                                <dt>应用部署路径 </dt> <dd>{{ $list->app_path }}</dd>
                                <dt>Logs 路径 </dt> <dd>{{ $list->app_logs_path }}</dd>
                                <dt>Config 路径 </dt> <dd>{{ $list->app_configs_path }}</dd>
                                <dt>服务器环境 </dt> <dd>{{ $list->server_env }}</dd>
                                <dt>默认部署分支 </dt> <dd>{{ $list->default_branch }}</dd>
                                <dt>忽略的文件 </dt> <dd>{!! nl2br($list->exclude_files) !!}</dd>
                                <dt>创建时间 </dt> <dd>{{ $list->created_at }}</dd>
                                <dt>修改时间 </dt> <dd>{{ $list->updated_at }}</dd>
                            </dl>
                            
                        </div>
                        <div class="panel-footer clearfix">
                            <div class="pull-left">
                                <a class="btn btn-info btn-sm" href="{{ url('deploy/'.$project['id']) }}">去部署</a>
                            </div>
                            <div class="pull-right">
                                <a class="btn btn-info btn-sm" href="{{ url('project/edit/'.$project['id']).'-'.$list->id }}">修改</a>
                                <a class="btn btn-info btn-sm" href="{{ url('project/remove/'.$project['id']).'-'.$list->id }}">删除</a>
                                <a class="btn btn-info btn-sm" title="克隆一份同样的配置，然后在该基础上进行修改" href="{{ url('project/clone/'.$project['id']).'-'.$list->id }}">克隆</a>
                            </div>
                        </div>
                    </div>
                    @endforeach
                    @if ($setting_list->isEmpty())
                        请先<a href="{{url('project/create/'.$project['id'])}}" class="">添加配置</a>
                    @endif
                </div>
            </div>
        </div>
    </div>
</div>
@endsection


